package bysj.service;

import bysj.dao.GraduateProjectSourceDao;
import bysj.domain.GraduateProjectSource;
import util.JdbcHelper;

import java.sql.Connection;
import java.sql.SQLException;

public class GraduateProjectSourceService {
    private GraduateProjectSourceDao graduateProjectSourceDao = GraduateProjectSourceDao.getInstance();
    private static GraduateProjectSourceService graduateProjectSourceService = new GraduateProjectSourceService();

    //Singleton
    private GraduateProjectSourceService(){}

    public static GraduateProjectSourceService getInstance(){
        return graduateProjectSourceService;
    }


    public GraduateProjectSource find(Integer id) throws SQLException {
        Connection connection = JdbcHelper.getConn();
        GraduateProjectSource graduateProjectSource = graduateProjectSourceDao.find(id,connection);
        JdbcHelper.close(connection);
        return graduateProjectSource;
    }
}
